export default {
  methods: {
    openPreview(_this, id) {
      let params = []
      let opoenUrl = `${_this.$KalixGlobalConfig.baseURL}/camel/rest/custom/servlet`
      let options = {
        id,
        classname: 'com.kalix.framework.core.impl.biz.DownloadFromBeanServlet',
        beanname: 'RedheadApply',
        filetype: 'html',
        access_token: _this.$KalixCatch.get('access_token')
      }
      for (let [key, value] of Object.entries(options)) {
        params.push(`${key}=${value}`)
      }
      window.open(`${opoenUrl}?${params.join('&')}`)
    }
  }
}
